package cn.lxh.task;


import cn.lxh.service.IPayOrderProfitsharingService;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ShardingTask {

    @Autowired
    private IPayOrderProfitsharingService profitsharingService;

    /**
     * 1、简单任务示例（Bean模式）
     */
    @XxlJob("shardingHandler")
    public void shardingHandler() throws Exception {
        log.info("开始执行分账....");
        try {
            profitsharingService.execSharding();
        }catch (Exception e){
            e.printStackTrace();
        }
    }

}
